# Creating a new Estimate Scenario Resource

This endpoint returns structured Estimate Scenario Resource objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array
and will be indexed by ID in the `estimate_scenario_resources` top-level JSON key.
Please see our [Response Format](#section/Response-Format) section for more information.

Endpoint: POST /estimate_scenario_resources
Version: 1.0.0

## Query parameters:

  - `include` (string)
    Any of the below associations can be included in your request by providing the `include` param, e.g. `include=association1,association2`.
- `allocation` (EstimateScenarioResourceAllocation) - The Estimate Scenario Resource Allocation of the Estimate Scenario Resource.
- `external_references` (ExternalReference) - Includes references to external integrations for this object.
- `geography` (Geography) - The Geography of the Estimate Scenario Resource.
- `organization_membership` (OrganizationMembership) - Retrieves the organization memberships for the resource. The response will include `organization_membership_id`, which references the data in the `organization_memberships` top-level key.
- `role` (Role)
- `user` (User).

## Request fields (application/json):

  - `estimate_scenario_resource` (object)

  - `estimate_scenario_resource.estimate_scenario_id` (integer, required)
    The estimate scenario to which the resource is attached.

  - `estimate_scenario_resource.label` (string)
    The name of the resource. An auto-generated label will be supplied if not present.

  - `estimate_scenario_resource.role_id` (integer, required)
    The role with which the resource will be associated.

  - `estimate_scenario_resource.allocation_attributes` (object)

  - `estimate_scenario_resource.allocation_attributes.duration_days` (integer)
    The number of business days a resource is expected to work on the project.

  - `estimate_scenario_resource.allocation_attributes.percent_allocated` (number)
    The percentage of available hours the resource will work on the project.

  - `estimate_scenario_resource.allocation_attributes.relative_start_day` (integer)
    The zero-based day that a scenario resource is expected to start working on the project, relative
to the start date of the estimate scenario.

  - `estimate_scenario_resource.external_reference` (object)
    Typically populated programmatically by a third party system via an integration, this is an optional
object that holds data from an external system. It connects objects in an external system with objects in
Kantata OX (for example, to connect a Jira issue to a Kantata OX Project).

  - `estimate_scenario_resource.external_reference.service_name` (string, required)
    The provider name of the integration. If you are adding multiple external references to the same object, the `service_name` must be unique.

  - `estimate_scenario_resource.external_reference.service_model` (string, required)
    The object type of the external object this external reference belongs to.

  - `estimate_scenario_resource.external_reference.service_model_ref` (string, required)
    The object ID of the external object this external reference belongs to.

  - `estimate_scenario_resource.external_reference.status` (string)
    The status of the integration. Options are `successful`, `pending`,  or `failed`.

  - `estimate_scenario_resource.external_reference.external_message` (string)
    The message on the external object.

  - `estimate_scenario_resource.external_reference.external_link` (string)
    The link to the external object.

  - `estimate_scenario_resource.external_reference.external_status` (string)
    The status of the external object in the external system.

  - `estimate_scenario_resource.external_reference.locked` (boolean)
    Whether the subject is locked.

## Response 200:

  - `200` (unknown)
    Estimate Scenario Resource has been created.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

  - `estimate_scenario_resources` (object)

  - `external_references` (object)

  - `users` (object)

  - `roles` (object)

  - `organization_memberships` (object)

  - `estimate_scenario_resource_allocations` (object)

  - `organizations` (object)

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized request

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 403:

  - `403` (unknown)
    Forbidden request

## Response 403 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 404:

  - `404` (unknown)
    Page Not Found

## Response 404 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 422:

  - `422` (unknown)
    Unprocessable Entity

## Response 422 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 503:

  - `503` (unknown)
    Service is unavailable

## Response 503 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

